package com.ddw.wotcg.client.threejs.renderers;

import com.ddw.wotcg.client.threejs.cameras.Camera;
import com.ddw.wotcg.client.threejs.math.Color;
import com.ddw.wotcg.client.threejs.scenes.Scene;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.Element;

/**
 * Extension to the THREE API, refactored some of the WebGLRenderer methods out
 * for re-use between the WebGLRenderer and CanvasRenderer
 * 
 * @author fungus1487
 * 
 */
public class Renderer extends JavaScriptObject {
	
	protected Renderer() {
	}
	
	public native final void clear(boolean color, boolean depth, boolean stencil) /*-{
		this.clear(color, depth, stencil);
	}-*/;
	
	public native final boolean getAutoClear() /*-{
		return this.autoClear;
	}-*/;
	
	public native final Element getDomElement() /*-{
		return this.domElement;
	}-*/;
	
	public native final boolean getSortObjects() /*-{
		return this.sortObjects;
	}-*/;
	
	public native final void render(Scene scene, Camera camera) /*-{
		this.render(scene, camera);
	}-*/;
	
	public native final void setClearColor(Color color, double alpha) /*-{
		this.setClearColor(color, alpha);
	}-*/;
	
	public native final void setClearColorHex(int hex, double alpha) /*-{
		this.setClearColorHex(hex, alpha);
	}-*/;
	
	public native final void setFaceCulling(String cullFace, String frontFace) /*-{
		this.setFaceCulling(cullFace, frontFace);
	}-*/;
	
	public native final void setSize(int width, int height) /*-{
		this.setSize(width, height);
	}-*/;
	
	public native final boolean supportsVertexTextures() /*-{
		return this.supportsVertexTextures();
	}-*/;
	
}
